/*
Author: Max E. K
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace OpenGado.DATA.Entities
{
	/// <summary>
	/// Address object for NHibernate mapped table 'address'.
	/// </summary>
	[Serializable]
	public class Address
	{
		#region Member Variables
		protected int _addressid;
		protected string _postaladdress;
		protected string _city;
		protected string _country;
		protected string _remarks;
		protected string _addresstype;
		protected Contact _contact;
		#endregion
		#region Constructors
			
		public Address() {}
					
		public Address(string postaladdress, string city, string country, string remarks, string addresstype) 
		{
			this._postaladdress= postaladdress;
			this._city= city;
			this._country= country;
			this._remarks= remarks;
			this._addresstype= addresstype;
		}

		#endregion
		#region Public Properties
		public  virtual int Addressid
		{
			get { return _addressid; }
			set {_addressid= value; }
		}
		public  virtual string PostalAddress
		{
			get { return _postaladdress; }
			set {_postaladdress= value; }
		}
		public  virtual string City
		{
			get { return _city; }
			set {_city= value; }
		}
		public  virtual string Country
		{
			get { return _country; }
			set {_country= value; }
		}
		public  virtual string Remarks
		{
			get { return _remarks; }
			set {_remarks= value; }
		}
		public  virtual string AddressType
		{
			get { return _addresstype; }
			set {_addresstype= value; }
		}
		public  virtual Contact Contact
		{
			get { return _contact; }
			set {_contact= value; }
		}
		#endregion
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Address castObj = (Address)obj;
			return ( castObj != null ) &&
			this._addressid == castObj.Addressid;
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			int hash = 57;
			hash = 27 * hash * _addressid.GetHashCode();
			return hash;
		}
		#endregion
		
	}
}
